<?php
  include_once("session.php");
  include_once('constants.php');
  if (IsSessionValid()) { 
    echo "<script>document.location='main.php';</script>";
    exit;
  }
  header("Content-Type: text/html; charset=utf-8");  
  $errordesc = $_GET['error']; 
  if ($errordesc){
    $error = true;
  } 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta name="verify-v1" content="Q1iOTxl0jXMJYzcOlD0pvdvDadwbkIn6CpAql5h8WQM=" />
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title><?php echo $product_name;?></title>
    <link rel="stylesheet" href="css/main.css" type="text/css">
<?php
  $serverName = $_SERVER["SERVER_NAME"];
  //$ip = gethostbyname ($SERVER_NAME);
  //$server = gethostbyaddr($ip); 
  if ( $serverName === "localhost")
  {
?>
  <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA6cs7716kYs3Ko1SvfMt_exQo_KDeR3Aqq1itQWePL6bFvREVmBR1hGKRwOjFtE3qlVLZ6mo8SU2EvQ" type="text/javascript">
  </script>
<?php
  } else {      
?>
  <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA6cs7716kYs3Ko1SvfMt_exQXdHDrzlCyUW1cOQLk9qowMRLGdxT4IMJUue67Jy2jbNedZmC-wzC96g" type="text/javascript">
  </script>  
<?php } ?>    
    <script type="text/javascript" src="scripts/md5.js"></script>
    <script type="text/javascript" src="scripts/array.js"></script>
    <script type="text/javascript" src="scripts/mymarkers.js"></script>
    <script type="text/javascript" src="scripts/main.js"></script>
    <script type="text/javascript">
      //<![CDATA[                                                  
      function loginSubmit() {
        if (document.forms["loginform"].username.value == '') {
          var error = document.getElementById("error");
          error.innerHTML = "Please enter your username.";          
          document.forms["loginform"].username.focus();
          return false;
        }
        if (document.forms["loginform"].password.value == '') {
          var error = document.getElementById("error");
          error.innerHTML = "Please enter your password.";          
          document.forms["loginform"].password.focus();
          return false;
        }

        document.forms["loginform"].secpassword.value = md5(document.forms["loginform"].password.value);
        document.forms["loginform"].password.value = '';
        return true;
      }
      //]]>
    </script>
    
  </head>
  <body onload="init(false)" onunload="GUnload()">    
    <div id="main">
      <?php 
      include ("header.php");      
      ?>
      <div id="content">           
      <div id="contentLeft">                             
        <h1>What's On Motion?</h1> 
        <p>
        It's a location-based mobile blog that allows you to:
        <ul id="features">
        <li><b>Find your friends anytime!</b><br/>Check your friends location, meet with them, share events and cool places. You can also find new friends that live around you.</li> 
        <li><b>Share your location on the go!</b><br/>If you find a cool place or event you can blog about it, send a photo and share it's location with others.</li>                
        </ul>
        Checkout in the map what other people are doing at this moment. 
        </p>                                                           
        <p>
        <center><h1><a class="main" href="register.php">Join now!</a></h1></center>
        </p>                                                                                                                                                            
      </div> <!-- content left -->
        
      <div id="map"></div>
      
      </div><!-- content -->                                              
      <?php include ("footer.php"); ?>      
    </div><!-- main -->
    <?php include ("ga.php"); ?>    
  </body>
</html>
